package yf.mall.vo.down;


import lombok.Data;
import java.util.Date;
import com.alibaba.excel.annotation.*;
import java.io.Serializable;


import java.math.BigDecimal;

import yf.mall.entity.CouponEntity;
import yf.mall.vo.CouponVo;

                                        import yf.mall.enums.CouponStatusEnum;

/**
 * 卡券实体
 * 表名 coupon
 *
 * @author hxf
 * @email 505860922@qq.com
 * @date ${datetime}
 */
@Data
public class CouponDown implements Serializable {
    @ExcelIgnore
    private static final long serialVersionUID = 1L;

                        //
            @ExcelProperty("")
            private Long id;
        
                        //用户
            @ExcelProperty("用户")
            private Long userId;
        
                        //创建时间
            @ExcelProperty("创建时间")
            private Date createTime;
        
                        //过期时间
            @ExcelProperty("过期时间")
            private Date expireTime;
        
                        //产生单号
            @ExcelProperty("产生单号")
            private String fromOrderNo;
        
                        //使用单号
            @ExcelProperty("使用单号")
            private String userOrderNo;
        
                        //面值
            @ExcelProperty("面值")
            private BigDecimal mount;
        
                        //详情
            @ExcelProperty("详情")
            private String info;
        
                        //可使用产品
            @ExcelProperty("可使用产品")
            private String goods;
        
                        //ENUM-状态:"NEW-未使用","USED-已使用"
            @ExcelIgnore
            private Integer status;
                        @ExcelProperty("状态")
            private String statusStr;
        
    
    public CouponDown() {

    }

    public CouponDown(CouponVo vo) {
        CouponEntity entity = vo.getEntity();
                                    this.setId(entity.getId());
            
                                    this.setUserId(entity.getUserId());
            
                                    this.setCreateTime(entity.getCreateTime());
            
                                    this.setExpireTime(entity.getExpireTime());
            
                                    this.setFromOrderNo(entity.getFromOrderNo());
            
                                    this.setUserOrderNo(entity.getUserOrderNo());
            
                                    this.setMount(entity.getMount());
            
                                    this.setInfo(entity.getInfo());
            
                                    this.setGoods(entity.getGoods());
            
                                    this.setStatus(entity.getStatus());
                if(entity.getStatus()!=null){
                    this.setStatusStr( CouponStatusEnum.indexOf(entity.getStatus()));
                }
            
            }


}
